/**
 * @param {number[]} nums
 * @return {void} Do not return anything, modify nums in-place instead.
 */
var moveZeroes = function (nums) {
    const n = nums.length;
    let slow = 0;
    let fast = 0;
    while (fast < n) {
        if (nums[fast] !== 0) {
            nums[slow++] = nums[fast];
        }
        fast++;
    }
    nums.fill(0, slow);
    return nums;
};
console.log(moveZeroes([1, 2, 3, 4, 0, 0, 5, 6]));